
from application import app, manager
from flask_script import Server
import www

manager.add_command('runserver', Server(
    host='0.0.0.0',
    port=app.config['SERVER_PORT'],
    use_debugger=True,
    use_reloader=True))

def main():
    app.run(host='0.0.0.0',
            port=app.config['SERVER_PORT'],
            use_debugger=True,
            use_reloader=True,
            debug=True)


if __name__ == '__main__':
    try:
        main()
    except Exception as e:
        # 打印出所有异常错误
        import traceback
        traceback.print_exc()
